package com.wanghuadi.beans;

/**
 * 学科枚举类
 *
 *      (3)学科枚举类的元素有：理工，文史，三校生
 */
public enum Subject {
    LG("理工"),WS("文史"),SXS("三校生");
    private String name;

    private Subject(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static Subject getByName(String name){
        Subject[] values = Subject.values();
        for (Subject value : values) {
            if(name.equals(value.getName())){
                return value;
            }
        }
        return null;
    }
}
